from multiprocessing import Pool

def f(x):
    return x*x

if __name__ == "__main__":
    p=Pool(5)  #创建进程池子
    list=[1,2,3,4,5,6,7,8,9]
    print(p.map(f,list))    #将list的元素映射到 f里
    



